//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_NORFLASH_H__
#define __ELASTOS_NORFLASH_H__

// flash baseaddr on normal mode
#define HwFlashBase         0x00000000
#define HwFlashInitOffset   0x00600000
#define HwFlashInitSize     0x01a00000
#define HwUserSpaceBase     0x0

#define HwFlashSectorSize   0x00020000

//BUGBUG: reserve one sector size for loader
#define HwFlashOffset       HwFlashSectorSize

#define ERASE_UNIT_SIZE     0x20000 // 128k erase unit

//==========================================================================
//flash operator functions
//==========================================================================
EXTERN_C int NorFlashEraseSector (unsigned long FlashBase, long Offset);
EXTERN_C int NorFlashWriteBuffer (unsigned long FlashBase, long Offset, unsigned char *Buffer, long BufferSize);
EXTERN_C int NorFlashReadBuffer  (unsigned long FlashBase, long Offset, unsigned char *Buffer, long BufferSize);

#endif // __ELASTOS_NORFLASH_H__

